CREATE TABLE [dbo].[Message]
(
[Id] [int] NOT NULL IDENTITY(1, 1),
[Subject] [nvarchar] (50) COLLATE Arabic_CI_AS NOT NULL,
[Body] [nvarchar] (max) COLLATE Arabic_CI_AS NOT NULL,
[SentDate] [datetime] NOT NULL,
[ThreadId] [int] NOT NULL,
[SenderId] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[Message] ADD CONSTRAINT [PK_Message] PRIMARY KEY CLUSTERED  ([Id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Message] ADD CONSTRAINT [FK_Message_Member] FOREIGN KEY ([SenderId]) REFERENCES [dbo].[Member] ([Id])
GO
ALTER TABLE [dbo].[Message] ADD CONSTRAINT [FK_Message_Thread] FOREIGN KEY ([ThreadId]) REFERENCES [dbo].[Thread] ([Id])
GO
